#pragma once

class rock;
typedef rock *rock_ptr;
typedef const rock *const_rock_ptr;

class rock : public QGraphicsObject
{
    Q_OBJECT
public:
    rock(const QPoint &pos);
    ~rock();

    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    QPoint get_coord() const
    {
        return coord_;
    }

    void set_coord(const QPoint &coord)
    {
        coord_ = coord;
    }

protected:
    virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);

signals:
    void position_changed(rock_ptr r, const QPointF &pos);
    void dropped(rock_ptr r);

private:
    void cancel_turn();

private:
    //solitaire *sol_;
    QPoint coord_;
};

